chore(settings): remove deprecated freshAgent.fontScale setting#512
Conversation
freshAgent.fontScale has been inert for some time: no UI control, no runtime consumer (fresh-agent transcripts follow terminal.fontSize via --fresh-transcript-font-size), and deliberately excluded from persistence writes. Remove it entirely from shared/settings.ts: constants, local-key registration, type field, normalizers, default, and sanitize branch. Legacy inputs (old localStorage records, settings seeds) containing fontScale are now passively dropped by the existing allow-list sanitizers; regression tests pin that old records rehydrate cleanly with fontScale absent. The agentChat legacy migration path is kept -- it migrates the surviving fresh-agent keys and has no fontScale- specific code. Verified with npm run check (full coordinated suite green); zero fontScale references remain in production code. Generated with Amplifier Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1f6bedc8f2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| 'showThinking', | ||
| 'showTools', | ||
| 'showTimecodes', | ||
| 'fontScale', | ||
| ] as const |
There was a problem hiding this comment.
Drop fontScale when stripping freshAgent-only patches
With fontScale removed from this local-key list, stripLocalSettings({ freshAgent: { fontScale: 1.25 } }, { migrateLegacyFreshAgentAlias: false }) no longer enters the migratedFreshAgent branch because the sanitizer returns undefined, so the shallow-copied freshAgent object remains in next. That lets stale/deprecated patches sent through normalizeServerSettingsPatchForApi reach /api/settings as freshAgent.fontScale, which the strict server schema rejects instead of silently dropping as intended; delete/overwrite next.freshAgent whenever a raw freshAgent block exists but sanitizes to empty.
Useful? React with 👍 / 👎.
…umb, re-anchor Cherry-pick of main 5c56ecc (#516), recorded src/ deviation. The port's src/ is frozen at an older main snapshot, but this client-side restore fix (bounded codex .lost resume, durable_artifact_missing breadcrumb for codex terminals, and re-anchoring unattached panes on reconnect) needed to ship on the port branch ahead of full reconciliation. Three defects fixed (client-only, no server/shared changes): 1. FreshAgentView.tsx: the .lost-state recovery/retry reaction was claude-only even though markSessionLost fires for any provider on INVALID_SESSION_ID. A codex pane that went "lost" sat permanently abandoned. Extended to codex via the existing agentSession selector plus a new getCanonicalCodexResumeSessionId helper (codex threads don't have Claude's UUID-format validator). Opencode is unaffected -- it already has its own dedicated lost-thread recovery path. 2. TerminalView.tsx: on INVALID_TERMINAL_ID with no sessionRef/ codexDurability candidate, the client collapsed to a brand-new terminal and silently cleared restoreError, destroying any trace of the pane's prior durable identity. Added a tab-level sessionRef fallback so a pane can recover before collapsing to fresh, and codex panes now persist a durable_artifact_missing breadcrumb instead of a silent clean slate when genuinely no identity exists. Scoped to codex only -- claude/gemini keep their existing silent-clean-fresh contract. 3. TerminalView.tsx onReconnect: re-drives creation (same createRequestId, idempotent) for any pane still unanchored on every reconnect completion, fixing a one-shot restore when a second disconnect landed before terminal.created arrived. Adaptations required: none. `git cherry-pick -n 5c56ecc` applied cleanly with zero conflicts -- the port's frozen FreshAgentView.tsx/TerminalView.tsx still had identical context around every touched hunk, since main commits #512 (fontscale removal) and #513 (editor-font) that landed in the 49-commit gap do not touch either file. Verified by diffing the applied changes against main's diff: byte-identical. Verification on the port branch: - npx vitest run (2 cherry-picked test files): 111/111 passed (TerminalView.codex-identity.test.tsx 6 tests, FreshAgentView.test.tsx 105 tests) - TerminalView.lifecycle.test.tsx (claude/gemini silent-fresh contract): 128/128 passed - npx tsc --noEmit: clean - npm run build:client: succeeded, dist/client rebuilt - npx playwright test restore-matrix.spec.ts restore-sync05.spec.ts --project=rust-chromium --project=legacy-chromium: 14/14 passed git diff 737cb00 --name-only -- src/ now lists exactly 3 files: src/components/icons/provider-icons.tsx (pre-existing deviation) src/components/fresh-agent/FreshAgentView.tsx src/components/TerminalView.tsx Recorded in docs/plans/2026-07-17-rust-transition-campaign-status.md (frozen-paths deviation record). 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
What
Remove the inert
freshAgent.fontScalesetting entirely fromshared/settings.ts(constants, local-key registration, type field, normalizers, default, sanitize branch). Legacy localStorage records/seeds containingfontScaleare passively dropped by the existing allow-list sanitizers; regression tests pin clean rehydration. The agentChat legacy migration is kept (no fontScale-specific code). Spec doc included atdocs/plans/2026-07-08-remove-freshagent-fontscale-spec.md.Why
Dead weight — no UI control, no runtime consumer (fresh-agent transcripts follow
terminal.fontSize), already excluded from persistence writes; confirmed zero production references outsideshared/settings.ts.Verification
npm run checkfull coordinated suite green (8,692 tests)fontScalein production code returns zeroGenerated with Amplifier